/**
 * Created with IntelliJ IDEA.
 * User: liulinhui
 * Date: 18-10-9
 * Time: 下午2:59
 * Description: eosService
 */

import ecc from 'eosjs-ecc'

export function createKeys(cb) {
  ecc.randomKey().then(privateWif => {
    let pubKey = ecc.privateToPublic(privateWif);
    pubKey = pubKey.replace('EOS', 'DATX');
    let keys = {
      pubKey: pubKey,
      priKey: privateWif
    };
    cb(null, keys)
  });
}
